<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <title>产品商店</title>
    <link rel="stylesheet" href="../../styles/h5/reset.min.css"/>
    <link rel="stylesheet" href="../../styles/h5/errortankuang.css"/>
    <!--以上为公共css样式-->
    <link rel="stylesheet" href="../../styles/h5/index.css"/>

    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery-1.9.1.min.js"></script>
    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery.modal.js"></script>
    <!--以上为公共js文件-->
</head>
<body>
<div class="zz-top"></div>
<div class="zz-list">
    <ul>
        <!--<li>-->
        <!--<a href="javascript:;">-->
        <!--<span class="zz-left">立马付</span>-->
        <!--<span class="zz-right-arrow"></span>-->
        <!--<span class="zz-replace">已签约</span>-->
        <!--</a>-->
        <!--</li>-->
    </ul>
</div>
</body>
<script charset="utf-8" type="text/javascript" src="../../scripts/h5/utils.js"></script>
<script charset="utf-8" type="text/javascript">
    var queryURLParameter = utils.queryURLParameter();
    var merId = queryURLParameter.merId;
    var storeId = queryURLParameter.storeId;
    //merId = 60001100;
    //storeId = 60001101;
    var data = '';

    function bindHTML() {
        var str = '';
        for (var i = 0; i < data.length; i++) {
            var curData = data[i];
            console.log(curData.productName);
            str += '<li>';
            if (curData.productType == "1") {//productType==1 立马付
                str += '<a href="../../html/h5/productStoreMsg.html?storeId=' + storeId + '">';
            }else {
                str += '<a href="../../html/h5/productSettleMsg.html?merId=' + merId + '">';
            }
            str += '<span class="zz-left">' + curData["productName"] + '</span>';
            str += '<span class="zz-right-arrow"></span>';
            if (curData["state"] == 3) {
                str += '<span class="zz-replace">已签约</span>';
            } else {
                str += '<span class="zz-replace">未签约</span>';
            }
            str += '</a>';
            str += '</li>';
        }
        $(".zz-list ul").html(str);
    }
    $.ajax({
        url: utils.ajaxUrl()+"h5/store/receiver/getProductList",
        data: {
            merId: merId,
            storeId: storeId
        },
        async: false,
        type: 'get',
        success: function (res) {
            var res = JSON.parse(res);
            console.log(res);
            if (res && res.retCode == '0000') {
                data = res["productVo"];
                bindHTML();
            } else {
                utils.newModalPrompt(res.retMsg);
            }
        }
    });
</script>
<script charset="utf-8" type="text/javascript" src="../../scripts/h5/index.js"></script>

</html>